package com.hui.config.security.core.authority;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.util.Assert;

/**
 * url权限实体
 */
public final class UrlGrantedAuthority implements GrantedAuthority {
    private static final long serialVersionUID = 430L;
    private final String url;

    public UrlGrantedAuthority(String url) {
        Assert.hasText(url, "A granted authority textual representation is required");
        this.url = url;
    }

    public String getAuthority() {
        return this.url;
    }

    public int hashCode() {
        return this.url.hashCode();
    }

    public String toString() {
        return this.url;
    }
}
